console.log("我进来了  ");
import * as THREE from 'three'
export function echartCanvas(sence){
    let canvas = document.createElement("canvas");
    let ctx=canvas.getContext('2d');
    canvas.width=300;
    canvas.height=300;
    
    //制作矩形
    ctx.fillStyle="gray";
    ctx.fillRect(0,0,300,300);
    // 文字
    ctx.fillStyle='white';
    ctx.font='normal 20px "楷体"';
    ctx.fillText('这个平面将贴在正方体前表面',0,20)
    ctx.fillStyle = "tranparent";
    // 生成图片
    let url=canvas.toDataURL('../assets/rs4.jpeg');
    let geometry1=new THREE.PlaneGeometry(30,30);
    let material1 = new THREE.MeshBasicMaterial({
        map:new THREE.TextureLoader().load(url),
        side:THREE.DoubleSide,
        opacity:1,
        transparent:true
    })
    let rect = new THREE.Mesh(geometry1,material1)
    rect.position.set(0,0,25.1)
    sence.add(rect)
}
